<#import "../common/common.ftl" as common />
<@common.page>
	<!-- Classes -->
	<script type="text/javascript" src="${res}/js/ui/peanut.QueryPanel.js"></script>
	
	<script type="text/javascript">
		peanut.NewestProblemQuery = Ext.extend(peanut.QueryPanel, {
	    id: "QueryInfoPanelId",
	    //这个是数据源url
	    baseUrl: __base+"/dataquality/queryNewestProblemMonth",
	    ID: "userCode",
	    storeMapping: ["comcode","comcname","wrongcnt"],
	
	    //表单元素
	    row1: {
			layout:'column',
			bodyStyle:'border-width:0;',
			items:[{
				columnWidth:.5,  
	            layout:'form',
	            bodyStyle:'border-width:0;',
	            //baseCls:'x-plain',
	            items:[{
	            	id:'name1',
	            	xtype:'textfield',  
	            	labelStyle:'text-align:right;',
	                fieldLabel:'名称'
	            }]
			},{
				columnWidth:.5,  
	            layout:'form',
	            bodyStyle:'border-width:0;',
	            //baseCls:'x-plain',
	            items:[{
	            	xtype:'textfield',  
	            	labelStyle:'text-align:right;',
	                fieldLabel:'名称2' 
	            }]
			}]
	    },
	    
	    constructor: function(config){
	        //this.sm = new Ext.grid.CellSelectionModel();
	        
	        this.cm = new Ext.grid.ColumnModel([
	            new Ext.grid.RowNumberer(),//获得行号
			    //this.sm,
			    {
			        header:"公司代码",
			        dataIndex:"comcode",
			        align:'center',
			        style:'font-weight:bold;',
			        //可以进行排序
	                sortable:true
		        },{
			        header:"公司名称",
			        dataIndex:"comcname",
			        align:'center',
	                sortable:true,
	                style:'font-weight:bold;'
		        },{
			        header:"问题笔数",
			        width:80,
			        style:'font-weight:bold;',
			        align:'center',
			        dataIndex:"wrongcnt",
	                sortable:true
		        }
		    ]);
	        
	        /**
		     * 表单定义开始
		    **/
		    var fp = new Ext.form.FormPanel({
		    	plain:true,
		    	frame:true,
		    	bodyStyle:'border-width:0;height:95.5%;width:100%',
				layout:"form",
				//defaultType:"textfield",
				labelWidth:75,
		        //baseCls:"x-plain",
				//defaults:{anchor:"30%",msgTarget:"side"},
				anchor:'100%',
				autoHeight:true,
				buttonAlign:"right",
				labelAlign:"center",
				//bodyStyle:"padding:10 10 10 10",
		    	items:[this.row1],
		    	buttons:[{
		    		text:'查询',
		    		handler: this.onSearch,
		    		scope:this
		    	}]
		    });
		    /**
		     * 表单定义结束
		    **/
	        
		    //额外属性
	        config.fp = fp,
	        
	        peanut.NewestProblemQuery.superclass.constructor.call(this,config);
	    },
	    onSearch:function() {
	    	//var keyword = this.fp.items[2].getValue();//得到输入框的值
	    	var p1 = Ext.getCmp('name1').getValue();
	    	alert(p1);
	        this.store.load({
	            params: {
	                start: 0,
	                limit: 10,
	                p1: p1
	            }
	        });
	    }
	});
		
		Ext.onReady(function(){
			var reportQuery = new peanut.NewestProblemQuery({
				renderTo:Ext.getBody(),
				header:false
			});
		});
	</script>
	</head>
<body style="background-color:transparent">
</body>
</@common.page>